Skip to content

Conversation

@jsdw
Copy link
Collaborator

@jsdw jsdw commented Nov 11, 2025

The goal of this is to convert historic metadata formats to subxt_metadata::Metadata. This will make it much easier to extend Subxt to work at historic blocks, as we no longer have to abstract over modern vs "old" metadatas or deal with legacy types. Things like codegen at historic blocks for instance will hopefully "Just Work" (though we will see if that holds up in practise!).

The main thing involved here is taking a scale_info_legacy::TypeRegistrySet which contains definitions for historic types, and converting these definitions across to entries in the modern scale_info::PortableRegistry as needed, updating the corresponding type IDs across metadata as we convert it over.

The original plan was to convert things to frame_metadata::v15::Metadata, but there was a blocker: v15 metadata has a single "index" per pallet, but older metadatas have a different index for errors, calls and events in each pallet, which cannot be represented in v15 metadata. Thus, the easier initial route is to make the necessary changes to our internal subxt::Metadata to support this and any other differences.

The hope is that we can iterate on this and tweak/refine the Metadata struct as needed, and then apply our learnings from that and create an external format which can be shared more widely and act as a target which any metadata version (+ types where needed) can be converted into. PAPI and Subxt could both rely on this new target if they liked.

@jsdw jsdw changed the base branch from master to v0.50.x November 11, 2025 16:56
@jsdw jsdw force-pushed the jsdw-v0.50-convert-historic-metadata branch from c9852b5 to d668fa4 Compare November 12, 2025 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants